<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="cache-control" content="no-cache">
<title>Genivia - Portable threads and locking support</title>
<link href="genivia_tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="genivia_content.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="top">
 <div id="titlearea">
  <table height="72px" width="100%" cellspacing="0" cellpadding="0">
   <tbody>
    <tr>
     <td width="10%">&nbsp;</td>
     <td width="175px"><a href="http://www.genivia.com"><img alt="Genivia" src="GeniviaLogo2_trans_noslogan.png"/></a></td>
     <td class="tab_home"><a href="http://www.genivia.com">Home</a></td>
     <td class="tab_home"><a href="http://www.genivia.com/docs.html">Documentation</a></td>
     <td>
      <div style="float: right; font-size: 18px; font-weight: bold;">Portable threads and locking support</div>
      <br>
      <div style="float: right; font-size: 10px;">updated Wed Aug 17 2016</div>
     </td>
     <td width="10%">&nbsp;</td>
    </tr>
   </tbody>
  </table>
 </div>
<!-- Generated by Doxygen 1.8.10 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Portable threads and locking support </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The <a class="el" href="threads_8h.html">threads.h</a> and <a class="el" href="threads_8c.html">threads.c</a> code define the following portable API:</p>
<ul>
<li>THREAD_TYPE portable thread type</li>
<li>THREAD_ID returns current thread ID of type THREAD_TYPE*</li>
<li>THREAD_CREATE(t,f,a) start a thread (THREAD_TYPE*)t that calls f(a)</li>
<li>THREAD_DETACH(t) detach thread (THREAD_TYPE*)t</li>
<li>THREAD_JOIN(t) wait to join (THREAD_TYPE*)t</li>
<li>THREAD_EXIT exit the current thread</li>
<li>THREAD_CANCEL(t) kill a thread, dangerous, use only in extreme cases!</li>
<li>MUTEX_TYPE portable mutex type</li>
<li>MUTEX_INITIALIZER global initializer value for static locks</li>
<li>MUTEX_SETUP(m) setup lock (MUTEX_TYPE*)m</li>
<li>MUTEX_CLEANUP(m) cleanup lock (MUTEX_TYPE*)m</li>
<li>MUTEX_LOCK(m) acquire lock (MUTEX_TYPE*)m</li>
<li>MUTEX_UNLOCK(m) release lock (MUTEX_TYPE*)m</li>
<li>COND_TYPE portable condition variable type</li>
<li>COND_SETUP(c) setup condition variable (COND_TYPE*)c</li>
<li>COND_CLEANUP(c) cleanup condition variable (COND_TYPE*)c</li>
<li>COND_SIGNAL(c) signal condition variable (COND_TYPE*)c</li>
<li>COND_WAIT(c,m) wait on variable (COND_TYPE*)c in mutex (MUTEX_TYPE*)m </li>
</ul>
</div></div><!-- contents -->
<hr class="footer">
<address class="footer">
Copyright (C) 2016, Robert van Engelen, Genivia Inc., All Rights Reserved.
</address>
<address class="footer"><small>
Converted on Wed Aug 17 2016 10:37:47 by <a target="_blank" href="http://www.doxygen.org/index.html">Doxygen</a> 1.8.10</small></address>
<br>
<div style="height: 246px; background: #DBDBDB;">
</body>
</html>
